class TestClass {
    constructor(tin,tout,fn) {
        this.testIn = tin;
        this.testOut = JSON.stringify(tout);
        this.fn = fn;
        this.test();
    }

    test() {
        let rightOut = JSON.stringify(this.fn(this.testIn));
        if (rightOut !== this.testOut) {
            console.log(`----------------- error ----------------`);
            console.log(`input:\t` + JSON.stringify(this.testIn));
            console.log(`output:\t` + rightOut);
            console.log(`right:\t` + this.testOut);
            console.log(`----------------- ^^^^^ ----------------`);
        }
    }
}

module.exports = {
    TestClass
}
